package com.cloud.cmt.usermanage.constant;

/**
 * 浙江卓锐科技股份有限公司 版权所有 © Copyright 2017<br>
 * 说明: <br>
 * 项目名称: cloud-maintenance <br>
 * 创建日期: 2017年10月22日 17:24 <br>
 * 作者: <a href="6492178@gmail.com">汪萌萌</a>
 */
public enum EnterpriseConstants {
    /**
     * Industry type hotel user manager constants.
     * 行业类型:酒店
     */
    INDUSTRY_TYPE_HOTEL(1, "酒店"),
    /**
     * Industry type property user manager constants.
     * 行业类型:物业
     */
    INDUSTRY_TYPE_PROPERTY(2, "物业"),
    /**
     * Enterprise type independence user manager constants.
     * 企业性质:独立经营
     */
    ENTERPRISE_TYPE_INDEPENDENCE(1, "独立经营"),
    /**
     * Enterprise type chain user manager constants.
     * 企业性质:连锁经营
     */
    ENTERPRISE_TYPE_CHAIN(2, "连锁经营"),

    /**
     * Account status pending audit enterprise constants.
     * 账户状态:待审核
     */
    ACCOUNT_STATUS_PENDING_AUDIT(1, "待审核"),
    /**
     * Account status no audit enterprise constants.
     * 账户状态:审核未通过
     */
    ACCOUNT_STATUS_NO_AUDIT(2, "审核未通过"),
    /**
     * Account status probationing enterprise constants.
     * 账户状态:试用中
     */
    ACCOUNT_STATUS_PROBATIONING(4, "试用中"),
    /**
     * Account status paied enterprise constants.
     * 账户状态:使用中
     */
    ACCOUNT_STATUS_PAIED(5, "使用中"),
    /**
     * Account status drain away enterprise constants.
     * 账户状态:已流失
     */
    ACCOUNT_STATUS_DRAIN_AWAY(6, "已流失"),
    /**
     * Account status disable enterprise constants.
     * 账户状态:禁用
     */
    ACCOUNT_STATUS_DISABLE(7, "禁用"),

    /**
     * Account status enable enterprise constants.
     * 账户状态:启用
     */
    ACCOUNT_STATUS_ENABLE(8, "启用");


    private final int value;
    private final String name;

    EnterpriseConstants(int value, String name) {
        this.value = value;
        this.name = name;
    }

    /**
     * Get value int.
     *
     * @return the int
     */
    public final int getValue() {
        return value;
    }

    /**
     * Gets name.
     *
     * @return the name
     */
    public final String getName() {
        return name;
    }


    /**
     * Gets industry type.
     *
     * @param value the value
     * @return the industry type
     */
    public static String getEnterpriseType(Integer value) {
        String name;
        if (EnterpriseConstants.ENTERPRISE_TYPE_CHAIN.getValue() == value) {
            name = EnterpriseConstants.ENTERPRISE_TYPE_CHAIN.getName();
        } else if (EnterpriseConstants.ENTERPRISE_TYPE_INDEPENDENCE.getValue() == value) {
            name = EnterpriseConstants.ENTERPRISE_TYPE_INDEPENDENCE.getName();
        } else {
            name = "无";
        }
        return name;
    }

    /**
     * Gets industry type.
     *
     * @param value the value
     * @return the industry type
     */
    public static String getIndustryType(Integer value) {
        String name;
        if (EnterpriseConstants.INDUSTRY_TYPE_HOTEL.getValue() == value) {
            name = EnterpriseConstants.INDUSTRY_TYPE_HOTEL.getName();
        } else if (EnterpriseConstants.INDUSTRY_TYPE_PROPERTY.getValue() == value) {
            name = EnterpriseConstants.INDUSTRY_TYPE_PROPERTY.getName();
        } else {
            name = "无";
        }
        return name;
    }

    /**
     * Gets account status.
     *
     * @param value the value
     * @return the account status
     */
    public static String getAccountStatus(Integer value) {
        String name;
        if (EnterpriseConstants.ACCOUNT_STATUS_PENDING_AUDIT.getValue() == value) {
            name = EnterpriseConstants.ACCOUNT_STATUS_PENDING_AUDIT.getName();
        } else if (EnterpriseConstants.ACCOUNT_STATUS_NO_AUDIT.getValue() == value) {
            name = EnterpriseConstants.ACCOUNT_STATUS_NO_AUDIT.getName();
        } else if (EnterpriseConstants.ACCOUNT_STATUS_DISABLE.getValue() == value) {
            name = EnterpriseConstants.ACCOUNT_STATUS_DISABLE.getName();
        } else if (EnterpriseConstants.ACCOUNT_STATUS_PROBATIONING.getValue() == value) {
            name = EnterpriseConstants.ACCOUNT_STATUS_PROBATIONING.getName();
        } else if (EnterpriseConstants.ACCOUNT_STATUS_PAIED.getValue() == value) {
            name = EnterpriseConstants.ACCOUNT_STATUS_PAIED.getName();
        } else if (EnterpriseConstants.ACCOUNT_STATUS_DRAIN_AWAY.getValue() == value) {
            name = EnterpriseConstants.ACCOUNT_STATUS_DRAIN_AWAY.getName();
        } else {
            name = "无";
        }
        return name;
    }
}
